package com.atguigu.easyexcel.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.format.NumberFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;

/**
 * @description:
 * @author: KeepFresh
 * @time: 2021/4/13 16:15
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Student {

    /**
     * @ExcelProperty("学号") : 指定表格的表头名
     *
     */

    @ExcelProperty(value = "学号", index = 0)
    private Integer id;

    @ExcelProperty(value = "姓名", index = 1)
    private String name;

    @ExcelProperty(value = "身高", index = 3)
    // @ExcelIgnore // 忽略当前身高属性，就是这个字段不会导入的表格中
    @NumberFormat("#.#") // 小数点后保留一位
    private Double height;

    @DateTimeFormat("yyyy年mm月dd日 hh时mm分") // 设置时间日期格式
    @ExcelProperty(value = "生日", index = 2)
    private Date birthday;


}
